Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@file-services/memory

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@file-services/memory

An in-memory, sync/async, file system implementation.

  • 6.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
decreased by-11.67%
Maintainers
4
Weekly downloads
 
Created
Source

@file-services/memory

npm version package size

An in-memory, sync/async, file system implementation.

Contains a subset of node's fs API with additional helper functions.

Features:

  • Tiny.
  • Isomorphic. Works in both Node.js and web-browsers.
  • Implements the watch service API (for events).
  • Case insensitive.

Getting started

Install library in project:

npm i @file-services/memory

Then, use the programmatic API:

import { createMemoryFs } from '@file-services/memory';

const fs = createMemoryFs();

// library uses `posix`-style paths
// and exposes a subset of `fs` API
fs.writeFileSync('/file-in-root', 'file contents');

// several helper functions are included
fs.populateDirectorySync('/src', {
  'index.ts': '/* source code */',
  'another-file.ts': '/* more source code */',
});

fs.fileExistsSync('/src/another-file.ts'); // returns true

License

MIT

FAQs

Package last updated on 26 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc